package com.guowen.myaccount.frag_statistics;

import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.github.mikephil.charting.charts.BarChart;
import com.github.mikephil.charting.charts.PieChart;
import com.github.mikephil.charting.data.BarEntry;
import com.github.mikephil.charting.data.PieEntry;
import com.guowen.myaccount.R;
import com.guowen.myaccount.adapter.AccountAdapter;
import com.guowen.myaccount.db.AccountBean;
import com.guowen.myaccount.db.DBManager;

import java.util.ArrayList;
import java.util.List;


public abstract class BaseStatisticsFragment extends Fragment {

    PieChart pie;
    ListView accountLv;
    AccountAdapter adapter;
    List<AccountBean> mDatas;
    public int year, month;
    List<PieEntry> pieList;
    List<String> typeList;
    List<Float> moneyList;

    public BaseStatisticsFragment() {
        // Required empty public constructor
    }


    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        if (getArguments() != null) {
        }
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_base_statistics, container, false);
        // Inflate the layout for this fragment
        initView(view);
        initData();

        return view;
    }

    public abstract void initData();

    private void initView(View view) {
        pie = view.findViewById(R.id.frag_base_pie);
        accountLv = view.findViewById(R.id.frag_base_lv);
    }
}